#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){

    x = 0;
    
    ofSetFrameRate(30);
    
    prevTime = ofGetElapsedTimeMillis();
    
    t = timer(1000, 0);
}

//--------------------------------------------------------------
void testApp::update(){

//   x++;
    
    t.step();
    
    long currentTime = ofGetElapsedTimeMillis();
    
    x += 100 * ((currentTime - prevTime)/1000.0);
    
    prevTime = currentTime;
}

//--------------------------------------------------------------
void testApp::draw(){

    t.draw();
    
    ofCircle(x, ofGetHeight()/2, 100);
}

//--------------------------------------------------------------
void testApp::keyPressed(int key){

}

//--------------------------------------------------------------
void testApp::keyReleased(int key){

}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){

}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
    t.trigger();
}

//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){

}

//--------------------------------------------------------------
void testApp::windowResized(int w, int h){

}

//--------------------------------------------------------------
void testApp::gotMessage(ofMessage msg){

}

//--------------------------------------------------------------
void testApp::dragEvent(ofDragInfo dragInfo){ 

}